//
//  MessagerViewController.m
//  CPetro
//
//  Created by ggx on 2017/3/8.
//  Copyright © 2017年 高广校. All rights reserved.
//

#import "MessagerViewController.h"
#import "MessageDetailViewController.h"

#import "EntityMessager.h"
#import "OnceTitleCell.h"
@interface MessagerViewController ()

@end

@implementation MessagerViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.navigationItemTitle = @"消息";
}
-(void)refreshView{
    [super refreshView];//重写父类
    
    
    EntityMessager *t = (EntityMessager *)[EntityMessager getObjectFromDic:@{}];
    t.titleText = @"公告";
    
    EntityMessager *t2 = (EntityMessager *)[EntityMessager getObjectFromDic:@{}];
    t2.titleText = @"特大喜讯";
    
    [self.baseData addObject:t];
    [self.baseData addObject:t2];
}
-(void)loadMore{
    
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return [self.baseData count];
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *cellIdenti = @"OnceTitleCell";
    OnceTitleCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdenti];
    if (!cell) {
        cell = [[OnceTitleCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdenti];
    }
    cell.data          =  [NSString stringWithFormat:@"%@",[self.baseData[indexPath.row] titleText]];
    return cell;

}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    MessageDetailViewController *Vc = CreateViewController(@"MessageDetailViewController");
//    Vc.historyId = [[(HomeCell *)[tableView cellForRowAtIndexPath:indexPath] homeOrderEntity]orderId];
    PushViewController(Vc);
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
